﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using TestService.Contract.Data;

namespace TestService.Contract
{

    /// <summary>
    /// 文件上传、下载服务
    /// </summary>
    [ServiceContract]
    public interface IFileService
    {
        /// <summary>
        /// 上传文件
        /// </summary>
        /// <param name="fileBuffer">字节数组</param>
        /// <param name="clientFileName">文件名称</param>
        /// <param name="siteName">文件类型配置名称</param>
        /// <returns>上传结果</returns>
        [OperationContract]
        UploadFileResult UploadFile(byte[] fileBuffer, string clientFileName, string siteName);

        /// <summary>
        /// 上传私密文件
        /// </summary>
        /// <param name="fileBuffer">字节数组</param>
        /// <param name="clientFileName">文件名称</param>
        /// <returns>上传结果</returns>
        [OperationContract]
        UploadFileResult UploadSecrecyFile(byte[] fileBuffer, string clientFileName);

        /// <summary>
        /// 上传保单文件
        /// </summary>
        /// <param name="fileBuffer">字节数组</param>
        /// <param name="clientFileName">文件名称</param>
        /// <returns>上传结果</returns>
        [OperationContract]
        UploadFileResult UploadPolicyFile(byte[] fileBuffer, string clientFileName);

        /// <summary>
        /// 下载单个文件
        /// </summary>
        /// <param name="fileId">文件id</param>
        /// <returns>文件流字节数组</returns>
        [OperationContract]
        byte[] DownloadFile(int fileId);

        /// <summary>
        /// 下载多个文件压缩包
        /// </summary>
        /// <param name="fileIds">文件id列表</param>
        /// <returns>文件流字节数组</returns>
        [OperationContract]
        byte[] DownloadCompressFiles(List<int> fileIds);

        /// <summary>
        /// 下载文件
        /// </summary>
        /// <param name="fileId">文件id</param>
        /// <returns>下载文件结果</returns>
        [OperationContract]
        DownloadFileResult DownloadFileWithInfo(int fileId);
    }
}
